<?php
session_start();
$currentUser = $_SESSION["user"];
$id = $_GET["Id"];
$sql = "SELECT * FROM article WHERE Id = $id";
$conn = new mysqli("localhost","root","","myblog");
$rs = $conn -> query($sql);
if($conn->error){
    echo $conn->error;
    die($conn->error);
}
$detail = $rs->fetch_assoc();
if($currentUser["Id"]!==$detail["AuthorID"]){
    die("非本人操作,无法修改!");
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html charset=utf-8"/>
        <title>eleventh page</title>
    </head>
    <body>
        <form method="POST" action="test_7_article_modify_do.php?id=<?=$id ?>">
        <div>
            <label>标题</label>
            <input type="text" name="Title" value="<?=$detail["Title"]?>" />
        </div>
        <div>
            <label>内容</label>
            <br>
            <textarea name="Content" id="Content" cols="80" rows="20"><?=$detail["Content"]?></textarea>
        </div>
        <div>
            <?=$detail["AuthorName"]?>编辑于
            <?=$detail["UpdateTime"]?>
        </div>
        <div>
            <input type="submit" value="提交" />
        </div>
        <a href="test_7_article_list.php">返回列表</a>
        </form>
    </body>
</html>